var rem = 24;
$(window).resize(infinite);
function infinite() {
	var htmlWidth = $('html').width();
	if (htmlWidth >= 640) {
		$("html").css({
			"font-size" : "24px"
		});
	} else {
		rem = 24 / 640 * htmlWidth;
		$("html").css({
			"font-size" :  rem + "px"
		});
	}
}infinite();